<script type="text/javascript" language="javascript">
function listSubCategory(cat,sub_cat) 
{
	var category = document.getElementById(cat).value;

	$.post("ajax_file.php", {module:'Classifieds', process:'listClassiCat', category: category}, function (getResult){
		$('#'+sub_cat+' option').remove();
		$('#'+sub_cat).append('<option value=""></option>');
		$('#'+sub_cat).append(getResult);
	});
}

function ListingLevel(val)
	{
		if(val==1)
		{
			document.getElementById('premiumid').style.display='none';
		}
		else
		{
			document.getElementById('premiumid').style.display='inline';
		}
	}
function validate()
{
	if(document.getElementById("pitem").value=="")
	{
		alert("Item Name Required");
		document.getElementById("pitem").focus();
		return false;	

	}
	if(document.getElementById("desc").value=="")
	{
		alert("Description  Too Short");
		document.getElementById("desc").focus();
		return false;	

	}
	
}
</script>
<style type="text/css">
.text
{
	width:300px;
	border:#ccc solid 1px;
	height:20px;
}
.text1
{
	width:300px;
	border:#ccc solid 1px;
	height:100px;
}
.sel
{
	width:300px;
	border:#ccc solid 1px;
	
}
.opt
{
	border:#ccc solid 1px;
}
.save

{
	height:25px;
	width:70px;
	border:#005F95 solid 1px;
	background-color:#005F95;
	color:#FFF;
	
}
td
{
	color:#555;
}
</style>
<div class="mainWarpArea">
    <!-- Begin contentwarp -->
    <div class="contentwarp">
      <div id="register" style="background-color:#FFF;float:left;width:740px;">
        <!-- Begin ContentBox -->       
<h2 style="padding-left: 20px;color:#005F95;" class="classifiedstitle">Post Ads</h2>
<form action="action.php" method="post" name="contact" enctype="multipart/form-data" onsubmit="return validate();">
  <table width="100%" align="center" border="0" cellpadding="0" cellspacing="0">
    <tbody><tr>
      <td valign="middle" align="left">&nbsp;</td>
    </tr>
    <tr>
      <td valign="middle" align="center">
      <fieldset class="borders" style="width: 600px;">
    <legend class="gray12">› Post Ads ‹</legend>
      <table cellspacing="0" cellpadding="5" border="0" align="center" width="99%" class="list">
<thead>
<tr>
	<td align="left" colspan="2">
        <div style="float: left;"></div>
    </td>
</tr>
</thead>
<tbody><tr>
	<td align="right" width="150">Item to Advertise</td>
    <td align="left"><input type="text" name="item" id="pitem" class="text"></td>
</tr>
<tr>
	<td align="right" width="150">Short Description</td>
    <td align="left"><textarea wrap="soft" rows="4" id="desc" cols="30" name="desc" class="text1"></textarea></td>
</tr>
<tr>
	<td align="right" width="150">Category</td>
    <td align="left">
    		
    	<select onchange="listSubCategory('category','sub_category');" id="category" name="category" class="sel">
    		<?php 
			$sql = "SELECT * FROM classifieds_category WHERE active_status='1'";
			$res = mysql_query($sql) or die(mysql_error());
			$i=1;
			while($data = mysql_fetch_array($res)) {
				echo '<option value="'.$data['id'].'"  >'.stripslashes($data['category']).'</option>';
			}
			?>
        </select>     
      </td> 
</tr>
<tr>
	<td align="right" width="150">Sub Category</td>
    <td align="left">
    	<select id="sub_category" name="sub_category" class="sel">>
    		
        </select>     
      </td> 
</tr>
<tr>
	<td align="right" width="150">Listing Level</td>
    <td align="left">
        	<input type="radio" onclick="document.getElementById('premiumid').style.display='none'" checked="checked" value="1" name="listinglevel" class="opt">&nbsp;STANDARD (2 categories)<br>
            <input type="radio" class="opt" onclick="document.getElementById('premiumid').style.display=''" value="2" name="listinglevel">&nbsp;PREMIUM (4 categories)
   	</td>
</tr>
</tbody><thead>
<tr>
	<td align="left" colspan="2">
        <div style="float: left; font-weight:bold; color:#005F95;">Business Template Details</div>
    </td>
</tr>
</thead>
<tbody><tr>
    	<td align="center" colspan="2">
            	<table cellspacing="0" cellpadding="0" border="0" align="center" width="100%">
                <tbody><tr>
                	<td align="right" width="150">Image 1</td>
                    <td align="left"><input type="file" name="tempimage1"></td>
                </tr>
                <tr>
                	<td align="right" width="150">Image 2</td>
                    <td align="left"><input type="file" name="tempimage2"></td>
                </tr>
                </tbody></table>
            <div style="display: none;" id="premiumid">
            	<table cellspacing="0" cellpadding="0" border="0" align="center" width="100%">
                <tbody><tr>
                	<td align="right" width="150">Image 3</td>
                    <td align="left"><input type="file" name="tempimage3"></td>
                </tr>
                <tr>
                	<td align="right" width="150">Image 4</td>
                    <td align="left"><input type="file" name="tempimage4"></td>
                </tr>
                <tr>
                	<td align="right" width="150">Image 5</td>
                    <td align="left"><input type="file" name="tempimage5"></td>
                </tr>
                <tr>
                	<td align="right" width="150">Image 6</td>
                    <td align="left"><input type="file" name="tempimage6"></td>
                </tr>    
                </tbody></table>
            </div>
        </td>
	</tr> 
</tbody><thead>
<tr>
	<td align="left" colspan="2">
        <div style="float: left;font-weight:bold; color:#005F95">Business Contact Details</div>
    </td>
</tr>
</thead>
<tbody><tr>
	<td align="right" width="150">Contact Email</td>
    <td align="left">
	<input type="text" class="text" name="contactemail">
	</td>
</tr>
<tr>
	<td align="right" width="150">Show Contact Email</td>
    <td align="left">
	<input type="radio" name="showcontactemail" value="1">&nbsp;Yes&nbsp;&nbsp;
    <input type="radio" checked="" name="showcontactemail" value="0">No
	</td>
</tr>
<tr>
	<td align="right" width="150">Address 1</td>
    <td align="left">
	<input type="text" class="text" name="address1">
	</td>
</tr>
<tr>
	<td align="right" width="150">Address 2</td>
    <td align="left">
	<input type="text" class="text" name="address2">
	</td>
</tr>
<tr>
	<td align="right" width="150">City</td>
    <td align="left">
	<input type="text" class="text" name="city">
	</td>
</tr>
<tr>
	<td align="right" width="150">State</td>
    <td align="left">
	<input type="text" class="text" name="state">
	</td>
</tr>
<tr>
	<td align="right" width="150">Postcode</td>
    <td align="left">
	<input type="text" class="text" name="postcode">
	</td>
</tr>
<tr>
	<td align="right" width="150">Phone</td>
    <td align="left">
	<input type="text" class="text" name="phone">
	</td>
</tr>
<tr>
	<td align="right" width="150">Fax</td>
    <td align="left">
	<input type="text" class="text" name="fax">
	</td>
</tr>
</tbody><thead>
<tr>
	<td align="left" colspan="2">
        <div style="float: left;font-weight:bold; color:#005F95">Business Long Description</div>
    </td>
</tr>
</thead>
<tbody><tr>
	<td align="left" colspan="2">
        	<textarea rows="8" cols="80" name="businessdesc"></textarea>
    </td>
</tr>
<tr>
    	<td align="left" colspan="2">
        	<input type="hidden" name="process" id="process" value="post_ads" />
            <input type="hidden" name="module" id="module" value="classifieds" />
        	<input type="submit" name="save_approval" value="Save" class="save">&nbsp;<input type="reset" class="save" value="Clear">
        </td>
  	</tr> 
</tbody></table>
    </fieldset>
      </td>
    </tr>
    <tr>
      <td valign="middle" align="left">&nbsp;</td>
    </tr>
  </tbody></table>
</form>

      </div>      
      
      <?php include("includes/right_content.php");?>
      <!-- End contentwarp -->
      <div style="clear:both;"></div>
    </div>
    <!-- End mainWarpArea -->
  </div>